package oop.day03.HomeWork2;

public class Test
{
    public static void main(String[] args)
    {
        Animal[] animals = new  Animal[4];
        animals[0] = new Dog("DD",2,"red");
        animals[1] = new Fish("rr",3,"gold");
        animals[2] = new Chick("Kun",2,"gray");
        animals[3] = new Chick("Kun Kun",3,"gray");

        for (Animal a :
                animals)
        {
            System.out.println("name = " + a.name);
            if(a instanceof Dog)
            {
                Dog dog = (Dog) a;
                dog.lookHome();
            }
            if(a instanceof Chick)
            {
                Chick chick = (Chick) a;
                chick.layEggs();
            }
            if(a instanceof Swim)
            {
                Swim swim = (Swim) a;
                swim.swim();
            }

            Master master = new Master();
            master.feed(new Dog("A",3,"red" ));
            master.feed(new Chick("G",3,"gray"));
            master.feed(new Fish("Little Purple",3,"purple"));


        }

    }
}
